3.445 \(\int \frac{(d \cos (e+f x))^n}{(a+a \sec (e+f x))^2} \, dx\)

Optimal. Leaf size=215 \[ \frac{2 (n+2) \sin (e+f x) (d \cos (e+f x))^n \text{Hypergeometric2F1}\left (\frac{1}{2},\frac{n}{2},\frac{n+2}{2},\cos ^2(e+f x)\right )}{3 a^2 f \sqrt{\sin ^2(e+f x)}}-\frac{(2 n+3) \sin (e+f x) \cos (e+f x) (d \cos (e+f x))^n \text{Hypergeometric2F1}\left (\frac{1}{2},\frac{n+1}{2},\frac{n+3}{2},\cos ^2(e+f x)\right )}{3 a^2 f \sqrt{\sin ^2(e+f x)}}-\frac{2 (n+2) \tan (e+f x) (d \cos (e+f x))^n}{3 a^2 f (\sec (e+f x)+1)}-\frac{\tan (e+f x) (d \cos (e+f x))^n}{3 f (a \sec (e+f x)+a)^2} \]

[Out]

(2*(2 + n)*(d*Cos[e + f*x])^n*Hypergeometric2F1[1/2, n/2, (2 + n)/2, Cos[e + f*x]^2]*Sin[e + f*x])/(3*a^2*f*Sq
rt[Sin[e + f*x]^2]) - ((3 + 2*n)*Cos[e + f*x]*(d*Cos[e + f*x])^n*Hypergeometric2F1[1/2, (1 + n)/2, (3 + n)/2,
Cos[e + f*x]^2]*Sin[e + f*x])/(3*a^2*f*Sqrt[Sin[e + f*x]^2]) - (2*(2 + n)*(d*Cos[e + f*x])^n*Tan[e + f*x])/(3*
a^2*f*(1 + Sec[e + f*x])) - ((d*Cos[e + f*x])^n*Tan[e + f*x])/(3*f*(a + a*Sec[e + f*x])^2)

________________________________________________________________________________________

Rubi [A]  time = 0.411779, antiderivative size = 215, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.261, Rules used = {4264, 3817, 4020, 3787, 3772, 2643} \[ \frac{2 (n+2) \sin (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac{1}{2},\frac{n}{2};\frac{n+2}{2};\cos ^2(e+f x)\right )}{3 a^2 f \sqrt{\sin ^2(e+f x)}}-\frac{(2 n+3) \sin (e+f x) \cos (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac{1}{2},\frac{n+1}{2};\frac{n+3}{2};\cos ^2(e+f x)\right )}{3 a^2 f \sqrt{\sin ^2(e+f x)}}-\frac{2 (n+2) \tan (e+f x) (d \cos (e+f x))^n}{3 a^2 f (\sec (e+f x)+1)}-\frac{\tan (e+f x) (d \cos (e+f x))^n}{3 f (a \sec (e+f x)+a)^2} \]

Antiderivative was successfully verified.

[In]

Int[(d*Cos[e + f*x])^n/(a + a*Sec[e + f*x])^2,x]

[Out]

(2*(2 + n)*(d*Cos[e + f*x])^n*Hypergeometric2F1[1/2, n/2, (2 + n)/2, Cos[e + f*x]^2]*Sin[e + f*x])/(3*a^2*f*Sq
rt[Sin[e + f*x]^2]) - ((3 + 2*n)*Cos[e + f*x]*(d*Cos[e + f*x])^n*Hypergeometric2F1[1/2, (1 + n)/2, (3 + n)/2,
Cos[e + f*x]^2]*Sin[e + f*x])/(3*a^2*f*Sqrt[Sin[e + f*x]^2]) - (2*(2 + n)*(d*Cos[e + f*x])^n*Tan[e + f*x])/(3*
a^2*f*(1 + Sec[e + f*x])) - ((d*Cos[e + f*x])^n*Tan[e + f*x])/(3*f*(a + a*Sec[e + f*x])^2)

Rule 4264

Int[(u_)*((c_.)*sin[(a_.) + (b_.)*(x_)])^(m_.), x_Symbol] :> Dist[(c*Csc[a + b*x])^m*(c*Sin[a + b*x])^m, Int[A
ctivateTrig[u]/(c*Csc[a + b*x])^m, x], x] /; FreeQ[{a, b, c, m}, x] &&  !IntegerQ[m] && KnownSecantIntegrandQ[
u, x]

Rule 3817

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> -Simp[(Cot[
e + f*x]*(a + b*Csc[e + f*x])^m*(d*Csc[e + f*x])^n)/(f*(2*m + 1)), x] + Dist[1/(a^2*(2*m + 1)), Int[(a + b*Csc
[e + f*x])^(m + 1)*(d*Csc[e + f*x])^n*(a*(2*m + n + 1) - b*(m + n + 1)*Csc[e + f*x]), x], x] /; FreeQ[{a, b, d
, e, f, n}, x] && EqQ[a^2 - b^2, 0] && LtQ[m, -1] && (IntegersQ[2*m, 2*n] || IntegerQ[m])

Rule 4020

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*
(B_.) + (A_)), x_Symbol] :> -Simp[((A*b - a*B)*Cot[e + f*x]*(a + b*Csc[e + f*x])^m*(d*Csc[e + f*x])^n)/(b*f*(2
*m + 1)), x] - Dist[1/(a^2*(2*m + 1)), Int[(a + b*Csc[e + f*x])^(m + 1)*(d*Csc[e + f*x])^n*Simp[b*B*n - a*A*(2
*m + n + 1) + (A*b - a*B)*(m + n + 1)*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, B, n}, x] && NeQ[A*
b - a*B, 0] && EqQ[a^2 - b^2, 0] && LtQ[m, -2^(-1)] &&  !GtQ[n, 0]

Rule 3787

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rule 3772

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(b*Csc[c + d*x])^(n - 1)*((Sin[c + d*x]/b)^(n - 1)
*Int[1/(Sin[c + d*x]/b)^n, x]), x] /; FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]

Rule 2643

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(Cos[c + d*x]*(b*Sin[c + d*x])^(n + 1)*Hypergeomet
ric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2])/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]), x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rubi steps

\begin{align*} \int \frac{(d \cos (e+f x))^n}{(a+a \sec (e+f x))^2} \, dx &=\left ((d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int \frac{(d \sec (e+f x))^{-n}}{(a+a \sec (e+f x))^2} \, dx\\ &=-\frac{(d \cos (e+f x))^n \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}-\frac{\left ((d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int \frac{(d \sec (e+f x))^{-n} (a (-3-n)-a (-1-n) \sec (e+f x))}{a+a \sec (e+f x)} \, dx}{3 a^2}\\ &=-\frac{2 (2+n) (d \cos (e+f x))^n \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac{(d \cos (e+f x))^n \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}-\frac{\left ((d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{-n} \left (-a^2 (1+n) (3+2 n)+2 a^2 n (2+n) \sec (e+f x)\right ) \, dx}{3 a^4}\\ &=-\frac{2 (2+n) (d \cos (e+f x))^n \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac{(d \cos (e+f x))^n \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}-\frac{\left (2 n (2+n) (d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{1-n} \, dx}{3 a^2 d}+\frac{\left ((1+n) (3+2 n) (d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{-n} \, dx}{3 a^2}\\ &=-\frac{2 (2+n) (d \cos (e+f x))^n \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac{(d \cos (e+f x))^n \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}-\frac{\left (2 n (2+n) \left (\frac{\cos (e+f x)}{d}\right )^{-n} (d \cos (e+f x))^n\right ) \int \left (\frac{\cos (e+f x)}{d}\right )^{-1+n} \, dx}{3 a^2 d}+\frac{\left ((1+n) (3+2 n) \left (\frac{\cos (e+f x)}{d}\right )^{-n} (d \cos (e+f x))^n\right ) \int \left (\frac{\cos (e+f x)}{d}\right )^n \, dx}{3 a^2}\\ &=\frac{2 (2+n) (d \cos (e+f x))^n \, _2F_1\left (\frac{1}{2},\frac{n}{2};\frac{2+n}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{3 a^2 f \sqrt{\sin ^2(e+f x)}}-\frac{(3+2 n) \cos (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac{1}{2},\frac{1+n}{2};\frac{3+n}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{3 a^2 f \sqrt{\sin ^2(e+f x)}}-\frac{2 (2+n) (d \cos (e+f x))^n \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac{(d \cos (e+f x))^n \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}\\ \end{align*}

Mathematica [F]  time = 1.67316, size = 0, normalized size = 0. \[ \int \frac{(d \cos (e+f x))^n}{(a+a \sec (e+f x))^2} \, dx \]

Verification is Not applicable to the result.

[In]

Integrate[(d*Cos[e + f*x])^n/(a + a*Sec[e + f*x])^2,x]

[Out]

Integrate[(d*Cos[e + f*x])^n/(a + a*Sec[e + f*x])^2, x]

________________________________________________________________________________________

Maple [F]  time = 0.299, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( d\cos \left ( fx+e \right ) \right ) ^{n}}{ \left ( a+a\sec \left ( fx+e \right ) \right ) ^{2}}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*cos(f*x+e))^n/(a+a*sec(f*x+e))^2,x)

[Out]

int((d*cos(f*x+e))^n/(a+a*sec(f*x+e))^2,x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (d \cos \left (f x + e\right )\right )^{n}}{{\left (a \sec \left (f x + e\right ) + a\right )}^{2}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cos(f*x+e))^n/(a+a*sec(f*x+e))^2,x, algorithm="maxima")

[Out]

integrate((d*cos(f*x + e))^n/(a*sec(f*x + e) + a)^2, x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{\left (d \cos \left (f x + e\right )\right )^{n}}{a^{2} \sec \left (f x + e\right )^{2} + 2 \, a^{2} \sec \left (f x + e\right ) + a^{2}}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cos(f*x+e))^n/(a+a*sec(f*x+e))^2,x, algorithm="fricas")

[Out]

integral((d*cos(f*x + e))^n/(a^2*sec(f*x + e)^2 + 2*a^2*sec(f*x + e) + a^2), x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{\left (d \cos{\left (e + f x \right )}\right )^{n}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec{\left (e + f x \right )} + 1}\, dx}{a^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cos(f*x+e))**n/(a+a*sec(f*x+e))**2,x)

[Out]

Integral((d*cos(e + f*x))**n/(sec(e + f*x)**2 + 2*sec(e + f*x) + 1), x)/a**2

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (d \cos \left (f x + e\right )\right )^{n}}{{\left (a \sec \left (f x + e\right ) + a\right )}^{2}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cos(f*x+e))^n/(a+a*sec(f*x+e))^2,x, algorithm="giac")

[Out]

integrate((d*cos(f*x + e))^n/(a*sec(f*x + e) + a)^2, x)